package de.upb.aquarium.api.camera;

import javax.media.opengl.GL;

import com.sun.opengl.util.GLUT;

import de.upb.aquarium.World;
import de.upb.aquarium.api.objects.General3DObject;

public class CameraAvatar extends General3DObject {

	float[] direction = new float[] {0f, 1f, 0f};
	
	@Override
	public void paint(GL gl) {
		beforeRendering(gl);
		
		gl.glDisable(GL.GL_LIGHTING);
		
		GLUT glut = World.getInstance().getGLUT();
		
		gl.glColor3d(1.0, 0.0, 0.0);
		glut.glutSolidSphere(0.2, 20, 20);
				
		gl.glLineWidth(5.0f);
		gl.glColor3d(0.0, 1.0, 0.0);
		gl.glBegin(GL.GL_LINES);
			gl.glVertex3d(0.0, 0.0, 0.0);
			gl.glVertex3fv(direction, 0);
		
		gl.glEnd();
		
		gl.glEnable(GL.GL_LIGHTING);
		
		afterRendering(gl);
	}
	
	public void setDirection(float[] dir)
	{
		direction = dir;
	}
}
